#pragma once
#include "qbbridge.h"
#include <guiframe/IModule.h>
#include <functional>
#include <map>
#if WIN32
#include <Windows.h>
#include <winuser.h>
#include <QtWin>
#endif

class QbModule : public IModule
{
public:
	static QbModule& instance();
	IApplication* app() const { return m_app; }

protected:
	// 通过 IModule 继承
	void initialize(IApplication* app) override;
	void unInitialize() override;
	int execCommand(CmdInfo ci) const override;
	bool closeCommandWindow(int cmdId, QWidget* widget) override;
private:
	QbModule() = default;

private:
	IApplication* m_app = nullptr;
    std::map<int, std::function<QWidget*(QString)> >	m_functions;
};
